import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'

export const constantRoutes = [

  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [{
      path: '/home',
      component: () => import('@/views/home/index'),
      meta: {
        title: '首页'
      }
    }]
  },

  {
    path: '/admin',
    redirect: '/admin/adminDefault',
    name: '权限管理',
    component: Layout,
    meta: {
      title: '权限管理'
    },
    children: [{
      path: 'adminDefault',
      name: '管理员管理',
      component: () => import('@/views/adminDefault/index'),
      meta: {
        title: '管理员管理'
      }
    },
    {
      path: 'jurisdiction',
      name: '角色管理',
      component: () => import('@/views/jurisdiction/index'),
      meta: {
        title: '角色管理'
      }
    },
    {
      path: '/admin/jurisdiction/ejurisdiction',
      name: '添加编辑角色',
      component: () => import('@/views/ejurisdiction/index')
    },
    {
      path: 'staff',
      name: '人员详情列表',
      component: () => import('@/views/staff/index'),
      meta: {
        title: '人员详情列表'
      }
    }
    ]
  },
  {
    path: '/archives',
    redirect: '/archives/resident',
    component: Layout,
    name: '房屋管理',
    meta: {
      title: '房屋管理'
    },
    children: [{
      path: 'resident',
      name: '住户信息',
      component: () => import('@/views/resident/index'),
      meta: {
        title: '住户信息'
      }
    },
    {
      // 编辑住户信息
      path: '/archives/resident/residentData',
      name: '编辑住户信息',
      component: () => import('@/views/residentData/index')
    },
    {
      path: 'building',
      name: '楼宇信息',
      component: () => import('@/views/building/index'),
      meta: {
        title: '楼宇信息'

      }
    },
    {
      path: 'houseDefault',
      name: '房屋信息',
      component: () => import('@/views/houseDefault/index'),
      meta: {
        title: '房屋信息'
      }
    },
    {
      // 编辑房屋信息
      path: '/archives/houseDefault/editHouseDefault',
      name: '编辑房屋信息',
      component: () => import('@/views/editHouseDefault/index')
    }

    ]
  },
  {
    path: '/personage',
    component: Layout,
    name: '个人信息管理',
    meta: {
      title: '个人信息管理'
    },
    children: [{
      path: 'authentication',
      name: '认证成功列表',
      component: () => import('@/views/authentication/index'),
      meta: {
        title: '认证成功列表'

      }
    },
    {
      path: 'authenticationIng',
      name: '申请认证列表',
      component: () => import('@/views/authenticationIng/index'),
      meta: {
        title: '申请认证列表'

      }
    },
    {
      path: 'disAuthentication',
      name: '认证失败列表',
      component: () => import('@/views/disAuthentication/index'),
      meta: {
        title: '认证失败列表'
      }
    }
    ]
  },
  // 物业缴费
  {
    path: '/charge',
    component: Layout,
    name: '收费明细',
    meta: {
      title: '收费明细'
    },
    children: [{
      path: 'checkstand',
      name: '未缴费列表',
      component: () => import('@/views/checkstand/index'),
      meta: {
        title: '未缴费列表'

      }
    },
    {
      path: 'bill',
      name: '已缴费列表',
      component: () => import('@/views/bill/index'),
      meta: {
        title: '已缴费列表'
      }
    },
    {
      path: 'paymath',
      name: '计费公式',
      component: () => import('@/views/paymath/index'),
      meta: {
        title: '计费公式'

      }
    }
    ]
  },
  // 电商
  {
    path: '/indents',
    component: Layout,
    name: '电商管理',
    meta: {
      title: '电商管理'
    },
    children: [{
      path: 'indent',
      name: '今日订单',
      component: () => import('@/views/indent/index'),
      meta: {
        title: '今日订单'

      }
    },
    {
      path: 'oldIndent',
      name: '历史订单',
      component: () => import('@/views/oldIndent/index'),
      meta: {
        title: '历史订单'
      }
    },
    {
      path: 'oldIndent/oldIndentDefault',
      name: '查看历史订单',
      component: () => import('@/views/oldIndentDefault/index')
    },
    {
      path: 'statistics',
      name: '每日统计',
      component: () => import('@/views/statistics/index'),
      meta: {
        title: '每日统计'
      }
    }
    ]
  },
  // 订单
  {
    path: '/order',
    component: Layout,
    name: '每日订单统计',
    alwaysShow: true,
    meta: {
      title: '每日订单统计'
    },
    children: [
      //
      {
        path: '/order/goodList',
        name: '商品列表',
        component: () => import('@/views/goodList/index')

      },
      // 商品详情
      {
        path: '/order/goodList/goodListShow',
        name: '商品详情',
        component: () => import('@/views/goodListShow/index')
      },
      {
        path: 'todayData',
        name: '每日数据待发货列表',
        component: () => import('@/views/todayData/index'),
        meta: {
          title: '每日数据待发货列表'
        }
      },
      {
        path: 'shipped',
        name: '每日数据已发货列表',
        component: () => import('@/views/shipped/index'),
        meta: {
          title: '每日数据已发货列表'
        }
      },
      {
        path: 'received',
        name: '每日数据已收货列表',
        component: () => import('@/views/received/index'),
        meta: {
          title: '每日数据已收货列表'
        }
      },
      {
        path: 'settleAccounts',
        name: '每日数据已结算列表',
        component: () => import('@/views/settleAccounts/index'),
        meta: {
          title: '每日数据已结算列表'
        }
      }
    ]
  },
  {
    path: '/repair',
    component: Layout,
    name: '工单管理',
    meta: {
      title: '工单管理'
    },
    children: [{
      path: 'repairs',
      name: '报修管理',
      component: () => import('@/views/repairs/index'),
      meta: {
        title: '报修管理'

      }
    },
    {
      path: 'repairsnum',
      name: '维修状态',
      component: () => import('@/views/repairsnum/index'),
      meta: {
        title: '维修状态'

      }
    }
    ]
  },
  {
    path: '/suggest',
    component: Layout,
    name: '物业服务',
    meta: {
      title: '物业服务'
    },
    children: [{
      path: 'announcement',
      name: '小区公告',
      component: () => import('@/views/announcement/index'),
      meta: {
        title: '小区公告'
      }
    },
    {
      // 编辑公告信息
      path: '/suggest/announcement/eAnnouncement',
      name: '编辑公告信息',
      component: () => import('@/views/eAnnouncement/index')
    },
    {
      path: 'suggests',
      name: '投诉建议',
      component: () => import('@/views/suggests/index'),
      meta: {
        title: '投诉建议'
      }
    },
    {
      path: 'message',
      name: '消息中心',
      component: () => import('@/views/message/index'),
      meta: {
        title: '消息中心'
      }
    }
    ]
  },
  {
    path: '/guide',
    component: Layout,
    name: '小区介绍',
    meta: {
      title: '小区介绍'
    },
    children: [{
      path: 'presentation',
      name: '社区指南',
      component: () => import('@/views/presentation/index'),
      meta: {
        title: '社区指南'
      }
    },
    {
      path: 'neightbor',
      name: '邻里公约',
      component: () => import('@/views/neightbor/index'),
      meta: {
        title: '邻里公约'
      }
    },
    {
      path: 'album',
      name: '相册列表',
      component: () => import('@/views/album/index'),
      meta: {
        title: '相册列表'
      }
    }
    ]
  },
  {
    path: '/management',
    component: Layout,
    name: '物业管理',
    meta: {
      title: '物业管理'
    },
    children: [{
      path: 'prompter',
      name: '巡更记录',
      component: () => import('@/views/prompter/index'),
      meta: {
        title: '巡更记录'
      }
    },
    {
      path: 'visitor',
      name: '访客记录',
      component: () => import('@/views/visitor/index'),
      meta: {
        title: '访客记录'
      }
    },
    {
      path: 'carport',
      name: '车辆出入库',
      component: () => import('@/views/carport/index'),
      meta: {
        title: '车辆出入库'
      }
    },
    {
      path: 'ammeter',
      name: '抄表信息',
      component: () => import('@/views/ammeter/index'),
      meta: {
        title: '抄表信息'
      }
    },
    {
      path: 'article',
      name: '物品放行记录',
      component: () => import('@/views/article/index'),
      meta: {
        title: '物品放行记录'
      }
    },

    {
      path: 'fitment',
      name: '装修备案记录',
      component: () => import('@/views/fitment/index'),
      meta: {
        title: '装修备案记录'
      }
    },

    {
      path: 'skill',
      name: '技能提升',
      component: () => import('@/views/skill/index'),
      meta: {
        title: '技能提升'
      }
    },
    {
      path: 'standard',
      name: '参考准则',
      component: () => import('@/views/standard/index'),
      meta: {
        title: '参考准则'
      }
    },
    {
      path: 'verbalTrick',
      name: '话术演练',
      component: () => import('@/views/verbalTrick/index'),
      meta: {
        title: '话术演练'
      }
    },
    {
      path: 'inform',
      name: '系统通知',
      component: () => import('@/views/inform/index'),
      meta: {
        title: '系统通知'
      }
    },
    {
      path: 'street',
      name: '街道通知',
      component: () => import('@/views/street/index'),
      meta: {
        title: '街道通知'
      }
    },
    {
      path: 'life',
      name: '生活知识',
      component: () => import('@/views/life/index'),
      meta: {
        title: '生活知识'
      }
    },
    {
      path: 'member',
      name: '党建引领',
      component: () => import('@/views/member/index'),
      meta: {
        title: '党建引领'
      }
    },
    {
      path: 'law',
      name: '法制保障',
      component: () => import('@/views/law/index'),
      meta: {
        title: '法制保障'
      }
    },
    {
      path: '/management/article/default',
      name: '放行物品详情',
      component: () => import('@/views/articleDefault/index')
    },
    {
      path: '/management/fitment/default',
      name: '装修备案详情',
      component: () => import('@/views/fitmentDefault/index')
    },
    {
      path: '/management/skill/default',
      name: '技能提升详情',
      component: () => import('@/views/skillDefault/index')
    },
    {
      path: '/management/standard/default',
      name: '参考准则详情',
      component: () => import('@/views/standardDefault/index')
    },
    {
      path: '/management/verbalTrick/default',
      name: '话术演练详情',
      component: () => import('@/views/verbalTrickDefault/index')
    },
    {
      path: '/management/life/default',
      name: '生活知识详情',
      component: () => import('@/views/lifeDefault/index')
    },
    {
      path: '/management/member/default',
      name: '党建引领详情',
      component: () => import('@/views/memberDefault/index')
    },
    {
      path: '/management/law/default',
      name: '法制保障详情',
      component: () => import('@/views/lawDefault/index')
    }
    ]
  },
  {
    path: '/lowCcarbon',
    name: '低碳管家',
    component: Layout,
    meta: {
      title: '低碳管家'
    },
    children: [{
      path: 'rubbish',
      name: '垃圾代扔订单',
      component: () => import('@/views/rubbish/index'),
      meta: {
        title: '垃圾代扔订单'
      }
    },
    {
      path: 'recycle',
      name: '闲置回收订单',
      component: () => import('@/views/recycle/index'),
      meta: {
        title: '闲置回收订单'
      }
    },
    {
      path: '/management/rubbish/default',
      name: '垃圾代扔订单详情',
      component: () => import('@/views/rubbishDefault/index')
    }
    ]
  },
  {
    path: '/safety',
    name: '安全管家',
    component: Layout,
    meta: {
      title: '安全管家'
    },
    children: [{
      path: 'safetyOrder',
      name: '等待接单',
      component: () => import('@/views/safetyOrder/index'),
      meta: {
        title: '等待接单'
      }
    },
    {
      path: 'safetyOrdering',
      name: '接单处理中',
      component: () => import('@/views/safetyOrdering/index'),
      meta: {
        title: '接单处理中'
      }
    },
    {
      path: 'safetyOrdered',
      name: '已完成接单',
      component: () => import('@/views/safetyOrdered/index'),
      meta: {
        title: '已完成接单'
      }
    },
    {
      path: '/management/safetyOrdered/default',
      name: '已完成接单详情',
      component: () => import('@/views/safetyOrderedDefault/index')
    }
    ]
  },
  {
    path: '/event',
    name: '事件管理',
    component: Layout,
    meta: {
      title: '事件管理'
    },
    children: [{
      path: 'eventing',
      name: '我来爆料',
      component: () => import('@/views/eventing/index'),
      meta: {
        title: '我来爆料'
      }
    },
    {
      path: 'evented',
      name: '爆料处理完成',
      component: () => import('@/views/evented/index'),
      meta: {
        title: '爆料处理完成'
      }
    }
    ]
  },
  {
    path: '/integral',
    name: '积分管理',
    component: Layout,
    meta: {
      title: '积分管理'
    },
    children: [{
      path: 'integralList',
      name: '积分列表',
      component: () => import('@/views/integralList/index'),
      meta: {
        title: '积分列表'
      }
    },
    {
      path: 'integralDetail',
      name: '积分明细',
      component: () => import('@/views/integralDetail/index'),
      meta: {
        title: '积分明细'
      }
    }
    ]
  },
  {
    path: '/people',
    name: '便民管家',
    component: Layout,
    meta: {
      title: '便民管家'
    },
    children: [{
      path: 'carriage',
      name: '送水订单',
      component: () => import('@/views/carriage/index'),
      meta: {
        title: '送水订单'
      }
    },
    {
      path: 'clean',
      name: '保洁订单',
      component: () => import('@/views/clean/index'),
      meta: {
        title: '保洁订单'
      }
    },
    {
      path: 'laundry',
      name: '洗衣订单',
      component: () => import('@/views/laundry/index'),
      meta: {
        title: '洗衣订单'
      }
    },
    {
      path: 'wash',
      name: '清洗订单',
      component: () => import('@/views/wash/index'),
      meta: {
        title: '清洗订单'
      }
    },
    {
      path: 'hourly',
      name: '钟点工',
      component: () => import('@/views/hourly/index'),
      meta: {
        title: '钟点工'
      }
    },
    {
      path: 'maternity',
      name: '保姆月嫂',
      component: () => import('@/views/maternity/index'),
      meta: {
        title: '保姆月嫂'
      }
    },
    {
      path: 'move',
      name: '搬家服务',
      component: () => import('@/views/move/index'),
      meta: {
        title: '搬家服务'
      }
    },
    {
      path: 'appliance',
      name: '家电维修',
      component: () => import('@/views/appliance/index'),
      meta: {
        title: '家电维修'
      }
    },
    {
      path: 'computer',
      name: '电脑维修',
      component: () => import('@/views/computer/index'),
      meta: {
        title: '电脑维修'
      }
    },
    {
      path: 'amend',
      name: '房屋装修',
      component: () => import('@/views/amend/index'),
      meta: {
        title: '房屋装修'
      }
    }
    ]
  },
  {
    path: '/ambitus',
    name: '周边管理',
    component: Layout,
    meta: {
      title: '周边管理'
    },
    children: [{
      path: 'shop',
      name: '周边商铺',
      component: () => import('@/views/shop/index'),
      meta: {
        title: '周边商铺'
      }
    },
    {
      path: 'hire',
      name: '房屋租赁',
      component: () => import('@/views/hire/index'),
      meta: {
        title: '房屋租赁'
      }
    },
    {
      path: 'coupon',
      name: '优惠卷领取',
      component: () => import('@/views/coupon/index'),
      meta: {
        title: '优惠卷领取'
      }
    },
    {
      path: '/ambitus/shop/default',
      name: '周边店铺详情',
      component: () => import('@/views/shopDefault/index')
    },
    {
      path: '/ambitus/hire/default',
      name: '房屋租赁详情',
      component: () => import('@/views/hireDefault/index')
    }
    ]
  },
  {
    path: '/expressage',
    name: '快递代收',
    component: Layout,
    meta: {
      title: '快递代收'
    },
    children: [{
      path: 'deposit',
      name: '快递存放',
      component: () => import('@/views/deposit/index'),
      meta: {
        title: '快递存放'
      }
    },
    {
      path: 'distribution',
      name: '配送完成',
      component: () => import('@/views/distribution/index'),
      meta: {
        title: '配送完成'
      }
    },
    {
      path: '/expressage/deposit/default',
      name: '配送完成详情',
      component: () => import('@/views/depositDefault/index')
    }
    ]
  },
  {
    path: '/operation',
    name: 'Operation',
    hidden: true,
    component: Layout,
    children: [{
      path: '/operation/app',
      name: 'App下载',
      component: () => import('@/views/appDownload/index')
    },
    {
      path: '/operation/use',
      name: '使用说明',
      component: () => import('@/views/use/index')
    }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]
const createRouter = () => new Router({
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRoutes
})

const router = createRouter()

export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
